<%@ page language="java" import="java.sql.*" errorPage="" import="javax.ws.rs.core.MediaType"  
import=" javax.ws.rs.core.UriBuilder" import=" com.sun.jersey.api.client.*" import=" com.sun.jersey.api.client.config.ClientConfig" 
import ="com.sun.jersey.api.client.config.DefaultClientConfig" import="classes.*" %>
<%

    
    String sIme=request.getParameter("lIme");
   
    String sUsername=request.getParameter("lUsername");
    String sPassword=request.getParameter("lPassword");
    String message="User login successfully ";
    
    try{
    	ClientConfig config1 = new DefaultClientConfig();
	    Client client = Client.create(config1);
	    WebResource service = client.resource(UriBuilder.fromUri("http://localhost:8080/eKupovina").build());
    	Market m = new Market();
    	m.setNaziv(sIme);
    	m.setUsername(sUsername);
    	m.setPassword(sPassword);
	    String s= service.path("webservices").path("marketi").path("market").path("novi").header("username", sUsername).header("password", sPassword).type(MediaType.APPLICATION_XML).accept(MediaType.APPLICATION_XML).put(String.class, m);
	 
	   
       response.sendRedirect("pocetnaKorisnicka.jsp?error="+message);
    
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
    
    
      

%>